import React from 'react';
import { Layout } from 'antd';
import Header from './component/header';
import { route } from './router/index';
import { Route, Switch } from 'react-router-dom';

function App () {
  return (
    <Layout className='page'>
      <Header />
      <Layout.Content>
        <div className="wrap">
          <Switch>
            {
              route.map((item, index) => {
                return <Route path={item.path}
                  exact={item.exact}
                  key={index}
                  render={(props) => {
                    return item.render(props)
                  }} />
              })
            }
          </Switch>
        </div>
      </Layout.Content>
    </Layout>)
};

export default App;
